package com.bosssoft.rbac.feign;

import com.bosssoft.rbac.model.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @author MaYunFei
 * @ProjectName boss-rbac
 * @Description TODO
 * @time 2022/7/6 9:04
 */
@FeignClient(value = "authorization-server")
public interface OAuth2FeignClient {

    @PostMapping("/oauth/token")
    ResponseEntity<JwtToken> getToken(
            @RequestParam("grant_type") String grantType , // 授权类型
            @RequestParam("username") String username , // 用户名
            @RequestParam("password") String  password , // 用户的密码
            @RequestParam("login_type")  String loginType,  // 登录的类型
            @RequestHeader("Authorization") String basicToken // Basic cmJhYy1hcGk6cmJhYy1zZWNyZXQ=由第三方客户端信息加密出现的值
    );

    @GetMapping("/user/info")
    String getUserInfo( @RequestHeader("Authorization") String authorization);
}
